{include file="common/header"}
<div class="content-wrapper">
    <section class="content-header">
        <h1>
          邀请好友排行奖励
            <small>邀请好友排行奖励</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 排行奖励设置</a></li>
            <li class="active">排行奖励设置</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    <!-- Tabs within a box -->
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#base" data-toggle="tab">排行奖励设置</a></li>
                    </ul>
					<h5>#直接修改奖励值点击空白处即可完成修改</h5>
                    <div class="page-content" style="padding: 20px 0">

                            <div class="tab-content">


                        <form method="post" class="form-horizontal form" id="post_form">
                            <div class="panel panel-info">
                                <div class="panel-heading">
                                    奖励设置
                                </div>
                                <div class="panel-body">

                                 <div class="form-group">
                                        <label class="col-sm-2 control-label">名次</label>
                                        <div class="col-sm-4 col-xs-6">
                                            奖金
                                        </div>
                                        <div class="col-sm-4 col-xs-6">
                                           最低邀请好友
                                        </div>
                                    </div>


                		{volist name="lists" id="v"}

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">第{$v.reward_id}名</label>
                                        <div class="col-sm-4 col-xs-6">
                                    <input type="hidden" name="reward_id[]" value="{$v['reward_id']}">

                                            <input class="form-control " type="text" name="num[]"  value="{$v.num}" placeholder=""  />
                                        </div>
                                        <div class="col-sm-4 col-xs-6">
                                            <input class="form-control " type="text" name="min[]"  value="{$v.min}" placeholder=""  />
                                        </div>
                                    </div>

                                    {/volist}

                <div class="col-sm-6 col-xs-12 col-sm-offset-2">
                    <button type="button"  name="submit" class="btn btn-primary submit">提交</button>
                </div>


                                </div>
                            </div>
                    </form>



<!--

                                <div class="tab-pane active" id="base">
                                <table>
                                    <tr>
                                        <th>排名</th>
                                        <th>奖励</th>

                                    </tr>

                    {volist name="lists" id="v"}
                                                            <tr>
                                                            <td>第{$v.reward_id}名</td>
                                                            <td><input type="text" class="point" data-id="{$v.reward_id}" value="{$v.num}"/></td>
                                             </tr>
                    {/volist}

                                 </table>

                                </div>

                                 -->
                            </div>

                    </div>
                    <script type="text/javascript">
                        $('.point').change(function(){
                			var i = $('.point').index(this);

                			$.post(
                                                                        window.location.href,
                                                                        {
                				num:$('.point').eq(i).val(),
                				reward_id:$('.point').eq(i).attr('data-id')
                			},
                                    function (res) {
                                        message(res.message,res.redirect,res.type)
                                    },'json'
                                );
						})

                        $('.submit').on('click',function(){
                            let data=$('form').serialize();
                          
                                $.post(
                                    window.location.href,
                                    data,
                                    function (res) {
                                        message(res.message,res.redirect,res.type)
                                    },'json'
                                );
                        })
                    </script>
                </div>
                <!-- /.nav-tabs-custom -->
            </div>
            <!-- /.col -->
        </div>
    </section>
</div>
{include file='common/ufooter'}
